cmake_minimum_required(VERSION 3.0)
project(xxxpcsc)

set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_C_FLAGS "$ENV{CXXFLAGS} -rdynamic -O3 -fPIC -ggdb -std=c11 -Wall -Wno-deprecated -Werror -Wno-unused-function")

include_directories(.)
include_directories(/usr/local/lic64)

link_directories(/usr/local/lib64)

set(LIB_SRC
	xxxpcsc/log.cpp
 	xxxpcsc/util.cpp
	xxxpcsc/config.cpp
	xxxpcsc/thread.cpp	
	)
#pthread不是linux默认多线程库 需要手动添加


add_library(xxXPCSC SHARED ${LIB_SRC})

add_executable(test ./tests/test.cpp)
add_dependencies(test xxXPCSC)
target_link_libraries(test xxXPCSC yaml-cpp pthread)

add_executable(test_config ./tests/test_config.cpp)
add_dependencies(test_config xxXPCSC)
target_link_libraries(test_config xxXPCSC yaml-cpp pthread)

add_executable(test_thread ./tests/test_thread.cpp)
add_dependencies(test_thread xxXPCSC)
target_link_libraries(test_thread xxXPCSC yaml-cpp pthread)  

SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
